# Maintainer: Dan McGee <dan@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
# Contributor: Jason Chu <jason@archlinux.org>

pkgname=cscope
pkgver=15.8.a
_realver=15.8a
pkgrel=3
pkgdesc="A developers tool for browsing program code"
arch=('i686' 'x86_64')
url="http://cscope.sourceforge.net/"
license=('BSD')
depends=('ncurses' 'sh')
source=(http://downloads.sourceforge.net/${pkgname}/${pkgname}-${_realver}.tar.gz)
md5sums=('b5c898ccedcfe2d4aa69537dad73b610')

build() {
	cd "${srcdir}/${pkgname}-${_realver}"
	sed -i 's|/usr/local/lib/cs|/usr/lib/cs|' contrib/ocs

	./configure --prefix=/usr
	make
}

package() {
	cd "${srcdir}/${pkgname}-${_realver}"
	make DESTDIR="${pkgdir}" install
  
	install -d ${pkgdir}/usr/lib/cs
	install -Dm644 COPYING "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE

	cd contrib/xcscope
	install -Dm644 xcscope.el "${pkgdir}"/usr/share/emacs/site-lisp/xcscope.el
	install -m755 cscope-indexer "${pkgdir}"/usr/bin
}
